/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React, {Fragment} from 'react';
import NavigationUtil from '../navigator/NavigationUtil'
import {connect} from 'react-redux'
import actions from '../action'
import {
  SafeAreaView,
  StyleSheet,
  ScrollView,
  Button,
  View,
  Text,
  StatusBar,
} from 'react-native';

export default class TrendingPage extends React.Component{
  
  render(){
    const {navigation} = this.props
    return (
      
      <View style={styles.sectionContainer}>
        <Text style={styles.sectionTitle}>TrendingPage</Text>
        <Button
          title = "改变主题色"
          onPress = {()=>{
            this.props.onThemeChange('#096')
          }}
          ></Button>
      </View>
    )
  }
 
};

const styles = StyleSheet.create({

  sectionContainer: {
    marginTop: 32,
    paddingHorizontal: 24,
  },
  sectionTitle: {
    fontSize: 24,
    fontWeight: '600',
    color:'#333',
  },
 
});



// const mapStateToProps = state=>({})
// const mapDispatchToProps = dispatch =>({
//   onThemeChange:theme=> dispatch(actions.onThemeChange(theme))
// })

// export default connect(mapStateToProps,mapDispatchToProps)(TrendingPage)